Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the default value of unsafeDisableTooltip to false and remove redundant props and wrappers #4702

Merged
merged 9 commits into from
Jul 9, 2024

Conversation

broccolinisoup
Copy link
Member

@broccolinisoup broccolinisoup commented Jun 27, 2024

Closes #2008
Related #4696

Note

We managed to complete the roll out at dotcom 🎉 (View the progress here (internal link only))

Changelog

Changed

  • The default value of unsafeDisableTooltip to false
  • Added unsafeDisableTooltip={true} a coupe of IconButton instances where it is not safe to enable tooltips.

Removed

  • Explicit Tooltip wrappers
  • unsafeDisableTooltip={false} prop since it is the default value now.

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

Copy link

changeset-bot bot commented Jun 27, 2024

🦋 Changeset detected

Latest commit: fd6bd57

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Jun 27, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 91.05 KB (-0.08% 🔽)
packages/react/dist/browser.umd.js 91.38 KB (+0.04% 🔺)

@github-actions github-actions bot temporarily deployed to storybook-preview-4702 June 27, 2024 05:12 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4702 June 27, 2024 06:23 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4702 June 27, 2024 06:50 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4702 June 28, 2024 02:58 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4702 June 28, 2024 03:37 Inactive
@broccolinisoup broccolinisoup changed the title Update the default value of unsafeDisableTooltip to false and remove redundant props and wrappers Update the default value of unsafeDisableTooltip to false and remove redundant props and wrappers Jun 28, 2024
@github-actions github-actions bot temporarily deployed to storybook-preview-4702 June 28, 2024 05:16 Inactive
@broccolinisoup broccolinisoup marked this pull request as ready for review June 28, 2024 05:18
@broccolinisoup broccolinisoup requested a review from a team as a code owner June 28, 2024 05:18
@broccolinisoup broccolinisoup requested a review from TylerJDev June 28, 2024 05:18
@broccolinisoup broccolinisoup changed the title Update the default value of unsafeDisableTooltip to false and remove redundant props and wrappers Do not merge: Update the default value of unsafeDisableTooltip to false and remove redundant props and wrappers Jun 28, 2024
@github-actions github-actions bot temporarily deployed to storybook-preview-4702 June 28, 2024 05:21 Inactive
expect(tooltipEl).not.toHaveAttribute(':popover-open')
})

// second ESC closes the dialog and returns focus
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is failing - Not sure how to address this. I am trying to await before pressing the second ESC but it doesn't seem to be working. Any suggestions, thoughts? 🤔

@joshblack joshblack removed their request for review July 2, 2024 15:25
@@ -140,7 +169,9 @@ describe('Dialog', () => {
})

it('Returns focus to returnFocusRef on escape', async () => {
const {getByTestId, queryByTestId} = HTMLRender(<Component />)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had an issue with this existing component. It was supposed to go back to the return ref after pressing the ESC twice (First closing the tooltip, second closing the dialog) but for some reason it didn't work, even though I waited for the previous keyboard event to be completed. This test wasn't about the tooltip itself; it is about the Dialog so I updated to use a different dialog but let me know if I am misinterpreting the issue I encountered.

@broccolinisoup broccolinisoup requested a review from joshblack July 3, 2024 23:22
@joshblack joshblack removed their request for review July 5, 2024 20:00
@broccolinisoup broccolinisoup changed the title Do not merge: Update the default value of unsafeDisableTooltip to false and remove redundant props and wrappers Update the default value of unsafeDisableTooltip to false and remove redundant props and wrappers Jul 8, 2024
@@ -11,7 +11,8 @@ export default {

export const IconButtons = () => (
<ButtonGroup>
<IconButton icon={PlusIcon} aria-label="Add" />
<IconButton icon={DashIcon} aria-label="Subtract" />
{/* We can remove these unsafe props after we resolve https://github.com/primer/react/issues/4129 */}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Good to know!

@@ -11,6 +11,7 @@ import type {ComponentProps} from './utils/types'
import {useRefObjectAsForwardedRef} from './hooks/useRefObjectAsForwardedRef'
import {XIcon} from '@primer/octicons-react'

// Dialog v1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Classic! 😅

Copy link
Member

@siddharthkp siddharthkp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Does what it says on the box, good work!

Lets run some integration tests with this before we merge

@siddharthkp siddharthkp added react integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jul 8, 2024
@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/332110

@broccolinisoup
Copy link
Member Author

Integration tests pass https://github.com/github/github/pull/332110 and tested on RL, everything looks good 🎉

@broccolinisoup broccolinisoup added this pull request to the merge queue Jul 9, 2024
Merged via the queue into main with commit 2536b49 Jul 9, 2024
36 checks passed
@broccolinisoup broccolinisoup deleted the default-tooltip-icon-button branch July 9, 2024 23:56
@primer primer bot mentioned this pull request Jul 9, 2024
@siddharthkp siddharthkp added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh react
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IconButton should include Tooltip by default
2 participants